Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Simple Polygons

Figure 7 shows a simple polygon.

Figure 7 A simple polygon

Labels

ASCII
Polygon
Binary
plyg ( = 0x706C7967 )

Data Format

uns32               nVertices
Point3D             vertices[nVertices]
nVertices
The number of vertices of the polygon.
vertices[]
An array of vertices that define the polygon.

Data Size

4 + (numVertices * 12)

Description

A simple polygon is a convex plane figure defined by a list of vertices. In other words, a simple polygon is a polygon defined by a single contour. (Vertices are assumed to be coplanar to within floating-point tolerances.) The lines connecting the vertices of a simple polygon do not cross. Attributes may be assigned to each vertex of a simple polygon and also to its entire face.

Default Surface Parameterization

None.

Parent Hierarchy

Shared, shape, geometry.

Parent Objects

None.

Child Objects

Vertex attribute set list (optional), attribute set (optional). A vertex attribute set list may be used to attach attribute sets to one or more vertices of the simple polygon. An attribute set may be used to attach attributes to the entire face of the simple polygon. For the purpose of attribute assignment, the vertices of a polygon are indexed by position in the array vertices[] ; that is, the index of vertices[i] is i . See "Vertex Attribute Set Lists" , for an explanation of the structure and syntax of these objects.

Example

Polygon(
    5                   #nVertices
    0   0   0           
    1   0   0           
    2   1   0           
    1   2   0
    0   1   0
)

Default Size

None.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |